package ihistoryApp.dal.controller;

import ihistoryApp.request.FollowRequest;
import ihistoryApp.request.GetFollowListRequest;
import ihistoryApp.service.FollowService;
import ihistoryApp.view.FollowView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;



@Controller
@RequestMapping("/follow")
public class FollowController {
    @Autowired
    private FollowService followService;

    @PostMapping("/follow")
    public ResponseEntity<String> follow(@RequestBody FollowRequest request) {
        return ResponseEntity.ok(followService.follow(request));
    }

    @PostMapping("/getFollowList")
    public ResponseEntity<List<FollowView>> getFollowList(@RequestBody GetFollowListRequest request) {
        return ResponseEntity.ok(followService.getFollowList(request));
    }

    @PostMapping("/getFanList")
    public ResponseEntity<List<FollowView>> getFanList(@RequestBody GetFollowListRequest request) {
        return ResponseEntity.ok(followService.getFanList(request));
    }
}
